package com.imti.mall.product.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.imti.mall.model.pms.pojo.PmsProductFullReduction;

import com.imti.mall.product.mapper.PmsProductFullReductionDynaSqlProvider;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.UpdateProvider;

import java.util.List;

@Mapper
public interface PmsProductFullReductionDao extends BaseMapper<PmsProductFullReduction> {

    /**
     * 根据商品id品满减表
     * @param id
     * @return
     */
    @Select("select id,product_id,full_price,reduce_price from pms_product_full_reduction where product_id=#{id}")
    public List<PmsProductFullReduction> getPmsProductFullReductionId(Integer id);

    /**
     * 根据满减表id修改品满减表
     * @param pmsProductFullReduction
     * @return
     */
    @UpdateProvider(type= PmsProductFullReductionDynaSqlProvider.class,method = "updatePmsProductFullReduction")
    public Integer updatePmsProductLadder(PmsProductFullReduction pmsProductFullReduction);
}
